﻿using System;
using System.Text;
using Mono.Collections.Generic;

namespace Mono.Cecil
{
	// Token: 0x0200005A RID: 90
	public sealed class CallSite : IMethodSignature, IMetadataTokenProvider
	{
		// Token: 0x17000041 RID: 65
		// (get) Token: 0x06000364 RID: 868 RVA: 0x0001A844 File Offset: 0x00018A44
		// (set) Token: 0x06000365 RID: 869 RVA: 0x0000338C File Offset: 0x0000158C
		public bool HasThis
		{
			get
			{
				return this.signature.HasThis;
			}
			set
			{
				this.signature.HasThis = value;
			}
		}

		// Token: 0x17000042 RID: 66
		// (get) Token: 0x06000366 RID: 870 RVA: 0x0001A864 File Offset: 0x00018A64
		// (set) Token: 0x06000367 RID: 871 RVA: 0x0000339C File Offset: 0x0000159C
		public bool ExplicitThis
		{
			get
			{
				return this.signature.ExplicitThis;
			}
			set
			{
				this.signature.ExplicitThis = value;
			}
		}

		// Token: 0x17000043 RID: 67
		// (get) Token: 0x06000368 RID: 872 RVA: 0x0001A884 File Offset: 0x00018A84
		// (set) Token: 0x06000369 RID: 873 RVA: 0x000033AC File Offset: 0x000015AC
		public MethodCallingConvention CallingConvention
		{
			get
			{
				return this.signature.CallingConvention;
			}
			set
			{
				this.signature.CallingConvention = value;
			}
		}

		// Token: 0x17000044 RID: 68
		// (get) Token: 0x0600036A RID: 874 RVA: 0x0001A8A4 File Offset: 0x00018AA4
		public bool HasParameters
		{
			get
			{
				return this.signature.HasParameters;
			}
		}

		// Token: 0x17000045 RID: 69
		// (get) Token: 0x0600036B RID: 875 RVA: 0x0001A8C4 File Offset: 0x00018AC4
		public Collection<ParameterDefinition> Parameters
		{
			get
			{
				return this.signature.Parameters;
			}
		}

		// Token: 0x17000046 RID: 70
		// (get) Token: 0x0600036C RID: 876 RVA: 0x0001A8E4 File Offset: 0x00018AE4
		// (set) Token: 0x0600036D RID: 877 RVA: 0x000033BC File Offset: 0x000015BC
		public TypeReference ReturnType
		{
			get
			{
				return this.signature.MethodReturnType.ReturnType;
			}
			set
			{
				this.signature.MethodReturnType.ReturnType = value;
			}
		}

		// Token: 0x17000047 RID: 71
		// (get) Token: 0x0600036E RID: 878 RVA: 0x0001A908 File Offset: 0x00018B08
		public MethodReturnType MethodReturnType
		{
			get
			{
				return this.signature.MethodReturnType;
			}
		}

		// Token: 0x17000048 RID: 72
		// (get) Token: 0x0600036F RID: 879 RVA: 0x0001A928 File Offset: 0x00018B28
		// (set) Token: 0x06000370 RID: 880 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public string Name
		{
			get
			{
				return string.Empty;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x17000049 RID: 73
		// (get) Token: 0x06000371 RID: 881 RVA: 0x0001A928 File Offset: 0x00018B28
		// (set) Token: 0x06000372 RID: 882 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public string Namespace
		{
			get
			{
				return string.Empty;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x1700004A RID: 74
		// (get) Token: 0x06000373 RID: 883 RVA: 0x0001A940 File Offset: 0x00018B40
		public ModuleDefinition Module
		{
			get
			{
				return this.ReturnType.Module;
			}
		}

		// Token: 0x1700004B RID: 75
		// (get) Token: 0x06000374 RID: 884 RVA: 0x0001A960 File Offset: 0x00018B60
		public IMetadataScope Scope
		{
			get
			{
				return this.signature.ReturnType.Scope;
			}
		}

		// Token: 0x1700004C RID: 76
		// (get) Token: 0x06000375 RID: 885 RVA: 0x0001A984 File Offset: 0x00018B84
		// (set) Token: 0x06000376 RID: 886 RVA: 0x000033D1 File Offset: 0x000015D1
		public MetadataToken MetadataToken
		{
			get
			{
				return this.signature.token;
			}
			set
			{
				this.signature.token = value;
			}
		}

		// Token: 0x1700004D RID: 77
		// (get) Token: 0x06000377 RID: 887 RVA: 0x0001A9A4 File Offset: 0x00018BA4
		public string FullName
		{
			get
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(this.ReturnType.FullName);
				this.MethodSignatureFullName(stringBuilder);
				return stringBuilder.ToString();
			}
		}

		// Token: 0x06000378 RID: 888 RVA: 0x000033E0 File Offset: 0x000015E0
		internal CallSite()
		{
			this.signature = new MethodReference();
			this.signature.token = new MetadataToken(TokenType.Signature, 0);
		}

		// Token: 0x06000379 RID: 889 RVA: 0x0001A9DC File Offset: 0x00018BDC
		public CallSite(TypeReference returnType) : this()
		{
			bool flag = returnType == null;
			if (flag)
			{
				throw new ArgumentNullException("returnType");
			}
			this.signature.ReturnType = returnType;
		}

		// Token: 0x0600037A RID: 890 RVA: 0x0001AA14 File Offset: 0x00018C14
		public override string ToString()
		{
			return this.FullName;
		}

		// Token: 0x040000D6 RID: 214
		private readonly MethodReference signature;
	}
}
